package com.ceba.test.modules.invalid.service;

import com.ceba.base.web.service.IBaseService;
import com.ceba.forveri.bean.SigntureVeriResult;
import com.ceba.test.modules.filemanage.entity.GFile;
import com.ceba.test.modules.invalid.dao.ReportInvalidDao;
import com.ceba.test.modules.invalid.entity.ReportInvalid;


public class ReportInvalidService extends IBaseService{
	
	private ReportInvalidDao reportInvalidDao;
	/**
	 * 添加一条记录
	 * @return
	 */
	public Boolean add(ReportInvalid rpi) throws Exception{
		return reportInvalidDao.add(rpi);
	}
	

	
	public ReportInvalid packReportInValidFromSig(ReportInvalid reportInvalid, SigntureVeriResult svr){
	
		return reportInvalidDao.packReportInValidFromSig(reportInvalid, svr);
		
	}
	/*
	 * 更新作废文档信息
	 */
	public boolean updateReportInValid(ReportInvalid reportInvalid, SigntureVeriResult svr) throws Exception{
		return reportInvalidDao.updateReportInValid(reportInvalid, svr);
	}
	/*
	 * 更新作废文档附件
	 * annix == 1 附件1
	 * annix == 2 附件2
	 */
	public boolean updateReportInValidByAnnix(GFile gFile, String reportId, int annix,boolean suc) throws Exception{
		return reportInvalidDao.updateReportInValidByAnnix(gFile, reportId, annix, suc);
	}
	
	/**
	 * 通过id查找
	 * @param reportId
	 */
	public ReportInvalid getInvalidReportByReportId(String reportId) {
		return reportInvalidDao.getInvalidReportByReportId(reportId);
	}
	
	/*
	 * 删除
	 */
	public boolean deleteReportByReportId(String reportId) {
	return  reportInvalidDao.deleteReportByReportId(reportId);
	}
	
	
	/**
	 * 更新某个属性的值
	 * @param reportId
	 * @param filed
	 * @param value
	 * @return
	 */
	public Boolean updateFiledValue(String id,String filed,String value) throws Exception{
		return  reportInvalidDao.updateFiledValue(id, filed, value);
	}

	/*
	 * 判断主键是否存在
	 */
	public boolean checkReportInvalidIdExsit(String id){
		return reportInvalidDao.checkReportInvalidIdExsit(id);
	}
	/**
	 * 根据reportId查找审核报告
	 * @param reportId
	 * @return
	 */
	public boolean checkHasReportInvalid(String reportId) {
		return false;
	}
	
	
	
	public ReportInvalidDao getReportInvalidDao() {
		return reportInvalidDao;
	}

	public void setReportInvalidDao(ReportInvalidDao reportInvalidDao) {
		this.reportInvalidDao = reportInvalidDao;
	}
	
}
